<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加文章</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../layui/css/modules/layer/default/layer.css" media="all">
    <script src="../js/jquery-2.1.0.min.js"></script>
    <script>
        function aaaa() {
            $.post("/article",$("#itemAddForm").serialize(),function (datas) {
                alert('成功');
            },"json");
        }
    </script>
</head>
<body style="margin: 2em;">
<form id="itemAddForm" class="layui-form layui-form-pane" action="" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">内容</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入内容" class="layui-textarea" name="content"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <button class="layui-btn" onclick="aaaa();">跳转式提交</button>
    </div>
</form>
<script src="../layui/layui.js"></script>
<script>
    layui.use('element', function () {
        var element = layui.element, $ = layui.jquery;
    });
</script>
</body>
</html>
